<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xml:lang="en-gb" xmlns="http://www.w3.org/1999/xhtml" lang="en-gb">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="robots" content="noindex,nofollow" />
	<title>Dragon Tool | Lazada.vn</title>
	<base href="{$smarty.const.HOST_STATIC}/admin/"></base>
	<link rel="stylesheet" href="css/login/system.css" type="text/css">
	<link href="css/login/login.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" type="text/css" href="css/login/rounded.css">
	<script type="text/javascript" src="{$smarty.const.HOST_STATIC}/libs/js/jquery/jquery.js"></script>
	<script type="text/javascript" src="{$smarty.const.HOST_STATIC}/www/js/conf/{$AppUI->lang_code}.conf.js"></script>
{literal}
<script language="javascript" type="text/javascript">
	function setFocus() {
		document.login.username.select();
		document.login.username.focus();
	}
	
	function refeshCaptcha(id)
	{
		var e = document.getElementById(id);
		if(e)
		{
			var u = HOST + '/captcha.jpg?p=' + Math.random();
			e.src = u;
		}
	}
</script>
{/literal}
</head>
<body onload="javascript:setFocus()">
	<div id="content-box">
		<div class="padding">
			<div id="element-box" class="login">
				<div class="m">
					<h1>Dragon Tool - Login Page</h1>					
					<div id="section-box">
						
						<div class="m" style="border:none;">
							<form action="" method="post" name="login" id="form-login" style="clear: both;" onsubmit="return submitLogin();">
								<p class="error hide" id="null_strUsername">
									<label>&nbsp;</label>
									<span class="inputbox">Email can not be null.</span>
								</p>
								<p id="form-login-username">
									<label for="modlgn_username">Email</label>
									<input name="username" id="strUsername" class="inputbox" size="30" type="text" value="{if $strUsername}{$strUsername}{/if}" />
								</p>
								<p class="error hide" id="null_strPassword">
									<label>&nbsp;</label>
									<span class="inputbox">Password can not be null.</span>
								</p>
								<p id="form-login-password">
									<label for="modlgn_passwd">Password</label>
									<input name="password" id="strPassword" class="inputbox" size="30" type="password" value="{if $strPassword}{$strPassword}{/if}">
								</p>
								<p class="error hide" id="null_strCountry">
									<label>&nbsp;</label>
									<span class="inputbox">Please choose your country.</span>
								</p>
								<p id="form-login-country">{$selectedCountry}
									<label for="country">Country</label>
									<select name="country" id="strCountry" class="inputbox country">
										<option value="0" style="padding-left:0px">Select your country</option>
										{foreach from=$arrCountry item=country}
										<option value="{$country.id}" class="{$country.id}"
											{if ($selectedCountry == $country.id)}
											  selected="selected"
											{/if}
										>{$country.name}</option>
										{/foreach}
									</select>
								</p>
								
								{if $intCaptcha==1}
								<p>
									<label for="strCaptcha">Captcha</label>
									<input type="text" name="strCaptcha" id="strCaptcha" class="inputbox" maxlength="6" style="width:100px; font-weight:bold;" />
								</p>
								<p>
									<label>&nbsp;</label>
									<img src="{$smarty.const.HOST_CAPTCHA}" id="imgCaptcha" style="margin-left:10px;" />
									<div>
										Can not see the verify code, 
										<a href="javascript:refeshCaptcha('imgCaptcha');">click here</a>.
									</div>
								</p>
								{/if}
								
								<div class="button_holder">
									<div class="button1">
										<div class="next" style=" text-align:center">
											<input type="submit" value="Login" class="button"/>
										</div>
									</div>
								</div>
								<div class="clr"></div>
							</form>
							<div class="clr"></div>
						</div>
					</div>
					<div id="lock"></div>
					<div class="clr"></div>
						
					{if $error==true}
					<p class="err">The username/ password is not correct</p>
					{/if}
					{if $intErrCaptcha==1}
					<p class="err">The verify code is not correct</p>
					{/if}
				</div>
			</div>
			
			<div class="clr"></div>
		</div>
	</div>
</div>
<div id="footer">
	<p class="copyright"></p>
</div>
{literal}
	<script type="text/javascript">
		function show_err(id, v)
		{
			var e = $('#'+v+'_'+id).show();
		}
		
		function submitLogin()
		{
			$('.error').hide();
			
			var eFocus	= '';
			var iCheck	= 0;
			
			var id	= 'strUsername';
			var e	= document.getElementById(id);
			if( !e.value )
			{
				e.focus();
				show_err(id, 'null');
				iCheck 	= 1;
				eFocus	= eFocus ? eFocus : e;
			}
			
			var id	= 'strPassword';
			var e	= document.getElementById(id);
			if( !e.value )
			{
				e.focus();
				show_err(id, 'null');
				iCheck 	= 1;
				eFocus	= eFocus ? eFocus : e;
			}
			
			var id	= 'strCountry';
			var e	= document.getElementById(id);
			if( !e.value || e.value=='0' || e.value=='0' )
			{
				e.focus();
				show_err(id, 'null');
				iCheck 	= 1;
				eFocus	= eFocus ? eFocus : e;
			}
			if(iCheck==1)
			{
				eFocus.focus();
				return false;
			}
			return true;
		}
	</script>
{/literal}
</body>
</html>
